<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<html>
<head>
    <title>统计会话次数 | session</title>
    <style>
        h1{color: red;text-align: center;size: 7px}
        p{color: green;text-align: center;size: 5px}
    </style>
</head>
<body>
<%! int Num = 0;%>
<%
if(session.isNew()){
    Num +=1;
    session.setAttribute("Num",Num);
}
%>
<h1>session计数器</h1>
<br>
<p>
你是第
<%= session.getAttribute("Num")%>
个访问本网站的用户
</p>

</body>
</html>